    package edu.rpi.bt.client;

    import com.allen_sauer.gwt.log.client.Log;
import com.apress.progwt.client.GWTApp;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

    public class AppBananaHello extends GWTApp{
        
        private static final String SECURE_TARGET_URL = "secure/manageTrips.html";

        private void loadGUI(Widget widget) {
            RootPanel.get(getPreLoadID()).setVisible(false);
            RootPanel.get(getLoadID()).add(widget);
        }

        public AppBananaHello(int pageID) {
            super(pageID);
            try {
                initConstants();

                initServices();
                
                setMeUp();
                

            } catch (Exception e) {
                error(e);
            }
        }

        private void setMeUp() {
            long start = System.currentTimeMillis();
            
            final HelloBanana hiBan = new HelloBanana(this);
            
            loadGUI( hiBan.getMapPanel() );
            long end = System.currentTimeMillis();
            Log.debug("GUI: " + (end - start) / 1000.0);

            final long start2 = System.currentTimeMillis();

    /*
            getLoginService().getUserOrDoLogin(SECURE_TARGET_URL,

            new AsyncCallback<User>() {

                public void onFailure(Throwable caught) {
                    Log.error("ToCollegeApp.setmeupFailure " + caught);
                }

                public void onSuccess(User result) {
                    long end2 = System.currentTimeMillis();
                    Log.debug("async: " + (end2 - start2) / 1000.0);
                    long start3 = System.currentTimeMillis();
                    banMan.load(result);
                    long end3 = System.currentTimeMillis();
                    Log.debug("load: " + (end3 - start3) / 1000.0);

                }
            });
    */
            
            // getSchoolService().getAllSchools(
            // new StdAsyncCallback<List<School>>("GetAllSchools") {
            //
            // public void onSuccess(List<School> result) {
            // List<HasAddress> schoolAddrs = new ArrayList<HasAddress>();
            // schoolAddrs.addAll(result);
            //
            // BulkGeoCoder geoCodeTimer = new BulkGeoCoder(
            // schoolAddrs, "school");
            // geoCodeTimer.schedule(4000);
            // }
            //
            // });
        }

        protected void error(Exception e) {

            Log.error("e: " + e);

            e.printStackTrace();

            VerticalPanel panel = new VerticalPanel();

            panel.add(new Label("Error"));
            panel.add(new Label(e.getMessage()));

            RootPanel.get(getPreLoadID()).setVisible(false);
            RootPanel.get(getLoadID()).add(panel);
        }

    }




